from django.template import Library
from history.models import AnimeHistory

register = Library()


@register.filter
def has_watched(anime, user):
    h = AnimeHistory.objects.filter(anime=anime, user=user).first()
    return True if h else False